<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<!--每个页面的title不一样-->
<head th:fragment="head(title)">
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title th:replace="${title}">博客详情</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css">
    <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
    <link rel="stylesheet" href="../static/css/me.css" th:href="@{/css/me.css}">
    <!--排版-->
    <link rel="stylesheet" href="../static/css/typo.css" th:href="@{/css/typo.css}">
    <!--动画-->
    <link rel="stylesheet" href="../static/css/animate.css" th:href="@{/css/animate.css}">
    <!--图标-->
    <link rel="icon" type="image/ico" sizes="144x144" href="../static/images/favicon.ico"
          th:href="@{/images/favicon.ico}"/>
    <!--代码高亮-->
    <link rel="stylesheet" href="../static/lib/prism/prism.css" th:href="@{/lib/prism/prism.css}">
    <!--目录生成-->
    <link rel="stylesheet" href="../static/lib/tocbot/tocbot.css" th:href="@{/lib/tocbot/tocbot.css}">
    <!--樱花背景-->
    <script src="https://api.ly522.com/js/yinghua.js"></script>
    <!--点击花花-->
    <script src="https://cdn.jsdelivr.net/gh/Sanarous/files@1.151/js/click.min.js"></script>


</head>
<body>

<!--导航-->
<nav th:fragment="menu(n)" class="ui inverted attached segment m-padded-tb-mini m-shadow-small">
    <div class="ui container">
        <div class="ui inverted secondary stackable menu">
            <h2 class="ui teal header secondary item">Andy的博客</h2>
            <a href="#" th:href="@{/main}" class="m-item item m-mobile-hide" th:classappend="${n==1} ? 'active teal'"><i
                    class="home icon"></i>首页</a>
            <a href="#" th:href="@{/types/-1}" class="m-item item m-mobile-hide"
               th:classappend="${n==2} ? 'active teal'"><i class="idea icon"></i>分类</a>
            <a href="#" th:href="@{/tags/-1}" class="m-item item m-mobile-hide"
               th:classappend="${n==3} ? 'active teal'"><i class="tags icon"></i>标签</a>
            <a href="#" th:href="@{/archives}" class="m-item item m-mobile-hide"
               th:classappend="${n==4} ? 'active teal'"><i class="clone icon"></i>归档</a>
            <a href="#" th:href="@{/about}" class="m-item item m-mobile-hide"
               th:classappend="${n==5} ? 'active teal'"><i class="info icon"></i>关于我</a>
            <div class="right item m-mobile-hide">
                <form name="search" action="#" th:action="@{/search}" method="post" target="_blank">
                    <div class="ui category search">
                        <div class="ui icon input">
                            <input type="text" name="query" class="prompt" placeholder="Search...." th:value="${query}">
                            <i onclick="document.forms['search'].submit()" class="search link icon"></i>
                        </div>
                        <div class="results"></div>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <a href="#" class="ui menu toggle black icon button m-top-right m-mobile-show">
        <i class="sidebar icon"></i>
    </a>
</nav>


<!--底部footer-->
<footer th:fragment="footer" class="ui inverted divided vertical segment m-padded-tb-massive">
    <div class=" ui stackable center aligned container">
        <div class="ui inverted divided stackable grid">
            <!--二维码-->
            <div class="three wide column">
                <div class="ui inverted link list">
                    <div class="item">
                        <img src="../static/images/wechat.jpg" th:src="@{/images/wechat.jpg}" class="ui rounded"
                             style="width: 130px" alt="二维码">
                    </div>
                </div>
            </div>

            <div class="three wide column">
                <h4 class="ui inverted header m-text-thin m-text-spaced">博客信息</h4>
                <div id="newblog-container">
                    <span id="htmer_time" style="color: orange"></span>
                </div>
            </div>

            <div class="three wide column">
                <h4 class="ui inverted header m-text-thin m-text-spaced">联系我</h4>
                <div class="ui inverted link list">
                    <a href="/about" th:href="@{/about}" class="item">Email：litaomailx@163.com</a>
                    <a href="/about" th:href="@{/about}" class="item m-text-thin">QQ：1490477595</a>
                </div>
            </div>

            <div class=" seven wide column">
                <h4 class="ui inverted header m-text-thin m-text-spaced">青玉案·元夕</h4>
                <p class="m-text-thin m-text-spaced m-opacity-mini">东风夜放花千树。更吹落、星如雨。宝马雕车香满路。凤箫声动，玉壶光转，一夜鱼龙舞。</p>
                <p class="m-text-thin m-text-spaced m-opacity-mini">蛾儿雪柳黄金缕。笑语盈盈暗香去。众里寻他千百度。蓦然回首，那人却在，灯火阑珊处。</p>
            </div>
        </div>
        <!--线条-->
        <div class="ui inverted section divider"></div>
        <div style="width:300px;margin:0 auto; padding:20px 0;">
            <a href="#" style="display:inline-block;text-decoration:none;height:20px;line-height:20px;"><img
                    th:src="@{/images/beian.png}" src="../static/images/beian.png" style="float:left;"/>
                <p style="float:left;height:20px;line-height:20px;margin: 0px 0px 0px 5px; color:#939393;">川公网安备
                    51052202010040号</p></a>
        </div>

    </div>

    <script>

        function secondToDate(second) {
            if (!second) {
                return 0;
            }
            var time = new Array(0, 0, 0, 0, 0);
            if (second >= 365 * 24 * 3600) {
                time[0] = parseInt(second / (365 * 24 * 3600));
                second %= 365 * 24 * 3600;
            }
            if (second >= 24 * 3600) {
                time[1] = parseInt(second / (24 * 3600));
                second %= 24 * 3600;
            }
            if (second >= 3600) {
                time[2] = parseInt(second / 3600);
                second %= 3600;
            }
            if (second >= 60) {
                time[3] = parseInt(second / 60);
                second %= 60;
            }
            if (second > 0) {
                time[4] = second;
            }
            return time;
        }

        function setTime() {
            /*此处为网站的创建时间*/
            var create_time = Math.round(new Date(Date.UTC(2021, 2, 24, 12, 59, 1)).getTime() / 1000);
            var timestamp = Math.round((new Date().getTime() + 8 * 60 * 60 * 1000) / 1000);
            currentTime = secondToDate((timestamp - create_time));
            currentTimeHtml = '本站已运行：' + currentTime[0] + '年' + currentTime[1] + '天'
                + currentTime[2] + '时' + currentTime[3] + '分' + currentTime[4]
                + '秒';
            document.getElementById("htmer_time").innerHTML = currentTimeHtml;
        }

        setInterval(setTime, 1000);
    </script>
</footer>


<th:block th:fragment="script">
    <script src="https://cdn.jsdelivr.net/npm/jquery@3.2/dist/jquery.min.js"></script>
    <script src="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery-scrollTo/2.1.2/jquery.scrollTo.min.js"></script>
    <script src="../static/lib/prism/prism.js" th:src="@{/lib/prism/prism.js}"></script>
    <script src="../static/lib/tocbot/tocbot.min.js" th:src="@{/lib/tocbot/tocbot.min.js}"></script>
    <script src="../static/lib/waypoints/jquery.waypoints.min.js"
            th:src="@{/lib/waypoints/jquery.waypoints.min.js}"></script>
    <!--自动生成对应网页的QR码-->
    <script src="../static/lib/qrcode/qrcode.min.js" th:src="@{/lib/qrcode/qrcode.js}"></script>

</th:block>


</body>
</html>
